#!/bin/bash
#
# Wrapper script for sshd daemon
#
# chkconfig: 2345 55 25
# description: Wrapper for OpenSSH server daemon
#
# source function library
. /etc/rc.d/init.d/functions

case "$1" in
	start)
		if [ -f /opt/hsc/data/.ssh_enabled ]
		then
		   /etc/rc.d/init.d/sshd start
	        fi
		;;
	stop)
		/etc/rc.d/init.d/sshd stop
		;;
	force_start)
		/etc/rc.d/init.d/sshd start
		touch /opt/hsc/data/.ssh_enabled
		;;
	force_stop)
		/etc/rc.d/init.d/sshd stop
		rm -f /opt/hsc/data/.ssh_enabled
		;;
	restart)
		/etc/rc.d/init.d/sshd restart
		;;
	reload)
		/etc/rc.d/init.d/sshd reload
		;;
	condrestart)
		/etc/rc.d/init.d/sshd condrestart
		;;
	status)
		/etc/rc.d/init.d/sshd status /usr/sbin/sshd
		RETVAL=$?
		;;
	*)
		echo $"Usage: $0 {start|stop|restart|reload|condrestart|status}"
		RETVAL=1
esac
exit $RETVAL
